package tw.com.softleader.service.impl;

import java.util.List;

import tw.com.softleader.dao.SpringDao;
import tw.com.softleader.service.SpringService;

public class SpringServiceImpl implements SpringService {

	private String greeting;

	private List<String> vendors;

	private SpringDao springDao;

	public void setGreeting(String greeting) {
		this.greeting = greeting;
	}

	public List<String> getVendors() {
		return vendors;
	}

	public void setVendors(List<String> vendors) {
		this.vendors = vendors;
	}

	public String getGreeting() {
		return greeting;
	}

	public SpringDao getSpringDao() {
		return springDao;
	}

	public void setSpringDao(SpringDao springDao) {
		this.springDao = springDao;
	}

	@Override
	public String getHello(String message) {
		String vendorStr = "";
		for (String vendor : vendors) {
			vendorStr += vendor + ";";
		}

		return greeting + " " + message;
	}

	public List<String> getAllFruits() {
		return springDao.findAll();
	}
}
